﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lab_se_4
{
    class sweet
    {
        public Random rand = new Random();
        public int price  {get; set;}
        public string name   {get; set;}
        public int number { get; set; }
        public int weight { get; set; }
        public sweet()
        {
            price = 0;
        }

        public sweet(int _name, int _price, int _number)
        {
            price = _price;
        }

        public void update_gems(int _name, int _price)
        {
            price = _price;
        }
    }

    
    class chocolate : sweet
    { }

    class cacao : chocolate
    {
       public cacao(int _weight)
        {
           name = "Шоколадные";
           weight = 15;
           int temp = Convert.ToInt32(_weight / weight);
           number = rand.Next(1, temp);
        }
    }

    class milk : chocolate
    {
        public milk(int _weight)
        {
            name = "Карамельные";
            weight = 20;
            int temp = Convert.ToInt32(_weight / weight);
            number = rand.Next(1, temp);
        }
    }
    
    
    class cookies : sweet
    { }

    class wafle: cookies
    {
        public wafle(int _weight)
        {
            name = "Вафли       ";
            weight = 10;
            int temp = Convert.ToInt32(_weight / weight);
            number = rand.Next(1, temp);
        }
    }

    class sand : cookies
    {
        public sand(int _weight)
        {
            name = "Печенье     ";
            weight = 25;
            int temp = Convert.ToInt32(_weight / weight);
            number = rand.Next(1, temp);
        }
    }



}
